// TestCaseModel
// (c)2007 Mark Bulmahn. mBulmahn@web.de
// License: GPL 2.0
// Project: TestCaseGenerator. http://www.codeplex.com/TestCaseGenerator

using System;
using System.Collections.Generic;
using System.Text;

namespace TestCaseModel
{
    /// <summary>
    /// A List of check results. This is used in a model for persisting the
    /// results of a model check
    /// </summary>
    [Serializable]
    public class ModelCheckResultList : List<ModelCheckResult>
    {
        public ModelCheckResultList()
        {
        }

        public List<string> GetAsText()
        {
            List<string> messages = new List<string>();
            foreach (ModelCheckResult res in this)
            {
                string msg = "";
                switch (res.Result)
                {
                    case ModelCheckResult.ResultType.ResultIsMissing:
                        msg = "No results assigned to test case  No." + res.ObjectDesc + "!";
                        break;
                    case ModelCheckResult.ResultType.ResultIsNeverUsedInModel:
                        msg = "Result '" + res.ObjectDesc + "' is never used in the model!";
                        break;
                    default:
                        msg = "Unknown message!";
                        break;
                }
                messages.Add(msg);
            }
            return messages;
        }
    }
}
